1. Field of the Invention
The invention relates in general to an image correction method, and more particularly to an image correction method, which, according to the pattern of the document scanned, determines whether the necessary reference gray level value with a maximum image pixel quantity should be greater or smaller than the middle gray level value calculated from the maximum gray level value and the minimum gray level value.
2. Description of the Related Art
Before scanning a document, a scanner normally proceeds with an image correction to avoid an undesirable image distortion of the scanned image. Among the many image correction methods available nowadays, the image correction method disclosed in Taiwan Patent Publication Serial No. 376648 will be used as an example for explanation in assistance with FIG. 1.
Please refer to FIG. 1. First of all, an all-white document is scanned and a scanned image is formed in procedure 102, wherein the scanned image includes a plurality of image pixels with each of them having a gray level value. Next, proceed to procedure 104 where these gray level values are ranked with each of them having an image pixel quantity, wherein a profile of gray level values, as shown in FIG. 2, is formed according to these gray level values and their corresponding image pixel quantities.
Referring to FIG. 2, the horizontal ordinate represents the gray level value whereas the vertical ordinate represents the image pixel quantity. When the reference basis measures 8 bits, the gray level value on the horizontal ordinate will have a distribution ranging from 0 to 255. A gray level value getting close to 255 implies that the image pixel is too white; on the contrary, a gray level value getting close to 0 implies that the image pixel is too black.
Ideally, when an all-white document is scanned, the profile of the gray level values should show a tendency towards white, i.e., the gray level value of the image pixel is near 255. In reality, due to the dusts alighting on the all-white document, a profile of gray level values whose distribution curve shows a peak at each of the two ends and a valley in the middle is resulted as shown in FIG. 2. Of which, the image pixels inside the right-end wave peak have higher gray level values showing a tendency towards white and a larger image pixel quantity, while the image pixels inside the left-end wave peak have lower gray level values showing a tendency towards black and a smaller image pixel quantity.
Next, proceed to procedure 106 where a median gray level value ME is taken from the profile of gray level values as shown in FIG. 2 and a standard error of the distribution S is calculated. Of which, the median value of gray level ME is close to the right-end wave peak because it occupies a larger portion of image pixels. Following that, proceed to procedure 108 where gray level values are selected from within the interval of (ME±ηS) wherein η ranges from 2 to 3.3. All of these gray level values selected from within the interval are weight averaged to obtain a corrected gray level value. This method ends here.
However, if blemishes on the all-white document are numerous or the scanner is interfered with by external noises during scanning, the gray level values obtained and their corresponding image pixel quantities might result in a profile as shown in FIG. 3. The image pixel quantity inside the right-end wave peak of FIG. 3 is smaller than that of FIG. 2, whereas the image pixel quantity inside the left-end wave peak of FIG. 3 is much larger than that of FIG. 2. If the median gray level value ME is taken from the profile of gray level values as shown in FIG. 3 and the standard error of the distribution S is calculated, the median gray level value ME will be closer to the left-end wave peak because it occupies a larger portion of image pixels. Furthermore, the corrected gray level value obtained by weight averaging the gray level values selected from the interval of (ME±ηS) would have enormous differences with expected results. Of whichηranges from 2 to 3.3. Therefore the abovementioned method cannot be applied to such a special condition.